
<!--layer弹出层1-->

<div class="panel-body" >

 <p class="text-muted"><span class="label label-info">直播流状态</span></p>    

 <div class="panel panel-default">

  <div>
   <div class="row">

     <div class="col-sm-12" >
       <div class="panel-heading">
       </div>
     </div>


   </div>
   <table id="streamTable" class="table table-striped m-b-none">
   </table>

 </div>

</div>

</div>

<!--  影视资源JS-->
<script type="text/javascript">

  function showStream(id){
    console.log(id);

  var streamTableUrl =  API_URL+"stream_info?query=delflag:0";



//初始化dataTable
var table =  $('#streamTable').DataTable({
  ajax: {
    url: streamTableUrl,
    dataSrc: ""
  },
    /* ajax: {
        url: streamTableUrl,  
          success:function(json){
            console.log("真实数据："+json);
            //清空表格
            $('#streamTable').dataTable().fnClearTable();  
            if(null==json){
              $('#streamTable').dataTable().fnClearTable();  
             }else{
               $('#streamTable').dataTable().fnAddData(json,true);  //刷下表格
             }  
          }
        },*/
  deferRender:true,
  Processing:true,
  buttons: [
  {
    extend: 'collection',
    text: 'Export',
    buttons: [ 'csv-flash', 'xls-flash', 'pdf-flash' ]
  }
  ],
            //默认最后一列（最后更新时间）降序排列
            order: [[3, "desc"]],

            //行创建完成后回调
            rowCallback: function (row, data, index) {

            },
            aoColumns: [


            { data: "Id" ,title: "流ID"},
            { data: "StreamName", title: "流名称" },
            { data: "StreamEnable"  ,title: "启用停用",
            render: function (data, type, row, meta) {
              if(row.StreamEnable==1){
                return "<i style='color:#2e8ded;' title='启用' class='fa fa-spinner fa-spin'></i>"; 
              }else{
                return "<i  title='停用' class='fa fa-spinner fa-spin'></i>";
              }
            }

          },
          { data: "UpdateTime",title: "更新时间",
          render: function (data, type, row, meta) {
            return getDateTime(data);
          } 
        }

        ],

        drawCallback: function( settings ) {


        },

        initComplete:function(data){



        },


        Paginate: true, 
        language:{
         url: 'vendor/jquery/datatables/Chinese.json'
       }

     });



top.layer.open({
  type: 1,
  title: '',
  shadeClose: false,
  anim: 1,
  shift: 4,
  shade: [0.5],
  fix: true,
  maxmin: true,
  move: true,
  area: ['800px', '660px'],
  content: $('#streamBody')
});
}




</script>







